﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

using SmartSiteManagementSystem.Models.Admin;

namespace SmartSiteManagementSystem.IRepository.Admin
{
    public interface IAdminMenuInfoRepository
    {

        /// <summary>
        /// 取得记录数
        /// </summary>
        /// <param name="param">可选参数为：</param>
        /// <returns></returns>
         int GetCount(Hashtable param);

        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="param">可选参数为：</param>
        /// <param name="orderBy">排序方式:默认为“AdminMenuId asc”</param>
        /// <param name="first">起始记录：从0开始</param>
        /// <param name="rows">提取的条数</param>
        /// <returns></returns>
        IList<AdminMenuInfo> GetList(Hashtable param, string orderBy, int first, int rows);

        IList<AdminMenuInfo> GetList(Hashtable param);


        /// <summary>
        /// 提取数据
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns></returns>
        AdminMenuInfo Get(Hashtable param);

        /// <summary>
        /// 插入数据
        /// </summary>
        /// <param name="obj">对象</param>
        /// <returns>返回：该条数据的主键Id</returns>
        int Insert(AdminMenuInfo obj);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        bool Update(Hashtable param);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        public bool Update(AdminMenuInfo obj);

        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="isParent">是否是父节点</param>
        /// <param name="catalogId">分类ID</param>
        /// <returns></returns>
        bool UpdateIsParentByMenuId(bool isParent, int adminMenuId);

        /// <summary>
        /// 更新HelpText数据 by xiuyun.wang 2012-9-14
        /// </summary>
        /// <param name="obj"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        bool UpdateHelpText(Hashtable param);

        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns>返回：ture 成功，false 失败</returns>
        bool Delete(Hashtable param);

        /// <summary>
        /// 删除节点，如果父节点下不再有子节点，更新父节点的IsParent字段为false
        /// </summary>
        /// <param name="catalogId"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        bool Delete(Int32 AdminMenuId, int parentId);

        /// <summary>
        /// 删除菜单和关联数据
        /// </summary>
        /// <param name="adminMenuId"></param>
        /// <returns></returns>
        bool DeleteMenuAndRelData(int adminMenuId);




}
}
